<html>
	<link rel="stylesheet" href="style.css"/>
	<head>
		<!--<style>
	
	tr:nth-child(odd){
	background-color:#00FFFF;
	}
	th{
	background-color:pink;
	}



		</style>-->
	</head>
<body class="pageBody">
	<form action = "health_promotion_home.php" method = "GET">
		<input type="submit" value="Back to Home" name="hphome"/>
	</form>
<form name="input" action ="health_promotion_search.php" method="get">
 Promotion venue:<input type="text" name="promo_venue">
<input type="submit" value="search">
</form>

<table class="listTable" border="1" width=100%">
		<tr class="lheader">
			<td colspan="100%" id="pageheader">
				Health Promotion Edit Page
			</td>
		</tr>
		<tr class="lheader" >
	<td>Promo_id</td><td>Date</td><td>Venue</td><td>Topic</td><td>Method</td>
	<td>Target_audience</td><td>Number of audience</td><td>Remarks</td>
	<td>Month</td><td>Latitude</td><td>Longitude</td><td>Image</td>
	<td>idcho</td><td>Subdistrict_id</td>
	</tr>

<?php
include("health_promo_class.php");
$obj = new health_promo_class();
	if(isset($_REQUEST["promo_venue"])){
	$obj->search_health_promo($_REQUEST["promo_venue"]);
	}
	else{
	$obj->get_all_health_promo();
	}
	
	$row=$obj->fetch();
	while($row){
	 echo "<tr><td>";
	echo $row["idhealth_promotion"];
	echo "</td>";
	echo "<td>";
	echo $row["date"];
	echo "</td>";
	echo "<td>";
	echo $row["venue"];
	echo "</td>";
	echo "<td>";
	echo $row["topic"];
	echo "</td>";
	echo "<td>";
	echo $row["method"];
	echo "</td>";
	echo "<td>";
	echo $row["target_audience"];
	echo "</td>";
	echo "<td>";
	echo $row["number_of_audience"];
	echo "</td>";
	echo "<td>";
	echo $row["remarks"];
	echo "</td>";
	echo "<td>";
	echo $row["month"];
	echo "</td>";
	echo "<td>";
	echo $row["latitude"];
	echo "</td>";
	echo "<td>";
	echo $row["longitude"];
	echo "</td>";
	echo "<td>";
	echo $row["image"];
	echo "</td>";
	echo "<td>";
	echo $row["idcho"];
	echo "</td>";
	echo "<td>";
	echo $row["subdistrict_id"];
	echo "</td>";
	echo "</tr>";
	$row=$obj->fetch();
	}

?>

</table>
</body>
</html>